﻿using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace ThunderboltCustomControlLibrary
{
	
	public class IconPathValueButton : Button
	{
		static IconPathValueButton()
		{
			DefaultStyleKeyProperty.OverrideMetadata(typeof(IconPathValueButton), new FrameworkPropertyMetadata(typeof(IconPathValueButton)));
		}

		#region 依赖属性

		//图片
		public Geometry Icon
		{
			get { return (Geometry)GetValue(IconProperty); }
			set { SetValue(IconProperty, value); }
		}

		// Using a DependencyProperty as the backing store for Icon.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconProperty =
			DependencyProperty.Register("Icon", typeof(Geometry), typeof(IconPathValueButton));


		/// <summary>
		///鼠标滑过时是否显示board的背景色
		/// </summary>       
		[Description("Gets or sets whether the board background color is displayed when the mouse is moved")]
		[Category("Common Properties")]
		public bool IsPanelVisible
		{
			get { return (bool)GetValue(IsPanelVisibleProperty); }
			set { SetValue(IsPanelVisibleProperty, value); }
		}
		public static readonly DependencyProperty IsPanelVisibleProperty =
			DependencyProperty.Register("IsPanelVisible", typeof(bool), typeof(IconPathValueButton), new PropertyMetadata(false));

		//图片尺寸
		public double IconSize
		{
			get { return (double)GetValue(IconSizeProperty); }
			set { SetValue(IconSizeProperty, value); }
		}

		// Using a DependencyProperty as the backing store for IconSize.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconSizeProperty =
			DependencyProperty.Register("IconSize", typeof(double), typeof(IconPathValueButton), new PropertyMetadata(25d));

		//图片与文字间隔
		public Thickness IconMargin
		{
			get { return (Thickness)GetValue(IconMarginProperty); }
			set { SetValue(IconMarginProperty, value); }
		}

		// Using a DependencyProperty as the backing store for IconMargin.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconMarginProperty =
			DependencyProperty.Register("IconMargin", typeof(Thickness), typeof(IconPathValueButton));

		//图片与文字排列方式
		public Orientation Orientation
		{
			get { return (Orientation)GetValue(OrientationProperty); }
			set { SetValue(OrientationProperty, value); }
		}

		// Using a DependencyProperty as the backing store for Orientation.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty OrientationProperty =
			DependencyProperty.Register("Orientation", typeof(Orientation), typeof(IconPathValueButton));

		#endregion
	}
}